import { ethers } from "hardhat";

import type { Blog } from "../../types/Blog";
import type { Blog__factory } from "../../types/factories/Blog__factory";

export async function deployBlogFixture(): Promise<{ blog: Blog }> {
  const signers = await ethers.getSigners();
  const admin = signers[0];


  const greeting = "My blog";
  const blogFactory = await ethers.getContractFactory("Blog");
  const blog = await blogFactory.connect(admin).deploy(greeting);
  await blog.waitForDeployment();

  return { blog };
}
